<?php

namespace app\validate\admin;

use app\common\validate\BaseValidate;

/**
 * Class Validate
 * https://www.kancloud.cn/manual/thinkphp6_0/1037624
 * @package app\daily\validate
 */
class Assistant extends BaseValidate
{
    //定义验证规则
    protected $rule = [
        'nickname|昵称' => 'require|unique:assistant',
        'tag|标签' => 'require',
        'member_id|用户id' => 'require|unique:assistant',
        'per_price|单价' => 'require|number',
        'store_id|门店id' => 'require',
        'avatar|头像' => 'require',
        'profile|简介' => 'require',
        'cover|封面' => 'require',
        'qr_code|头像' => 'require',
        'sign|个性签名' => 'require',
        'album|相册' => 'require',
        'score|评分' => 'require',
        'grade_id|等级' => 'require',
        'star|星数' => 'require|max:6',
        'is_recommend|推荐' => 'require',
    ];

    //定义验证场景要与方法名相同走自动验证
    protected $scene = [
        'create' => ['nickname', 'store_id', 'tag', 'per_price', 'avatar', 'profile', 'member_id',
            'cover', 'sign', 'album', 'is_recommend'],
        'update' => ['nickname', 'store_id', 'tag', 'per_price', 'avatar', 'profile', 'member_id',
            'cover', 'sign', 'album', 'grade_id', 'star', 'is_recommend'],
    ];

}
